from enum import  Enum

Month=Enum('Month',('Jan','Fab'))



#value属性则是自动赋给成员的int常量，默认从1开始计数。
for name,member in Month.__members__.items():
    print(name,'=>',member,',',member.value)


from enum import  Enum,unique

@unique#这个装饰器是检查这个枚举类型的重复值，（一般不能重复和c语言一样）
class Weekday(Enum):
    Sun=0
    Mon=1
    Tue=2
    Wed=3
    Thu=4
    Fri=5
    Sat=6

day1 =Weekday.Mon
print(day1)

print(Weekday['Tue'])

print(Weekday.Tue.value)

print(day1==Weekday.Mon)
print(day1==Weekday.Tue)

print(Weekday(6))

for name,member in Weekday.__members__.items():
    print(name,'=>',member)
